import React from 'react'
import { useNavigate } from 'react-router-dom'
import { Button } from 'antd-mobile'

function Index() {
  let navigate = useNavigate()
  const id = Math.random().toString().slice(2,6)
  // 跳转
  const handleToOrder = () => {
    navigate(`/order?id=${id}&title=确认订单&price=360}`)
  }
  return (
    <div>
      <Button block color='primary' size='large'
        onClick={() => handleToOrder()}
      >去确认订单
      </Button>
    </div>
  )
}

export default Index
